#!/bin/bash

set -e
if [ -z "${MountPoint}" ]; then
    # shellcheck source=../common/0_env.sh
    source "../common/0_env.sh"
fi

# test_all 不带任何参数全部执行
# test_all 0 全部执行
# test_all 1 执行指定脚本
function test_all()
{
    if (($# == 1)); then num=${1}; else num=0; fi

    if ((${num} == 0)) || ((${num} == 1)); then sh 1.test_create_unlink_regfile.sh; fi
    if ((${num} == 0)) || ((${num} == 2)); then sh 2.test_mkdir_rmdir.sh; fi
    if ((${num} == 0)) || ((${num} == 3)); then sh 3.test_symlink.sh; fi
    if ((${num} == 0)) || ((${num} == 4)); then sh 4.test_chown.sh; fi
    if ((${num} == 0)) || ((${num} == 5)); then sh 5.test_mknod.sh; fi
    if ((${num} == 0)) || ((${num} == 6)); then sh 6.test_rename_file.sh; fi
    if ((${num} == 0)) || ((${num} == 7)); then sh 7.test_rename_dir.sh; fi
    if ((${num} == 0)) || ((${num} == 8)); then sh 8.test_hardlink.sh; fi
    if ((${num} == 0)) || ((${num} == 9)); then sh 9.test_write.sh; fi
    if ((${num} == 0)) || ((${num} == 10)); then sh 10.test_truncate.sh; fi
}

test_all 0
